<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Apple devices fullscreen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" media="screen"/>
<link href="/public/plugins/layui/css/layui.css?v=v1.6.7" rel="stylesheet" type="text/css">
<link href="/public/static/admin/css/main.css?v=v1.6.7" rel="stylesheet" type="text/css">
<link href="/public/static/admin/css/page.css?v=v1.6.7" rel="stylesheet" type="text/css">
<link href="/public/static/admin/font/css/font-awesome.min.css?v=v1.6.7" rel="stylesheet" />
<link href="/public/static/admin/font/css/iconfont.css?v=v1.6.7" rel="stylesheet" />
<!--[if IE 7]>
  <link rel="stylesheet" href="/public/static/admin/font/css/font-awesome-ie7.min.css?v=v1.6.7">
<![endif]-->
<script type="text/javascript">
    var eyou_basefile = "/login.php";
    var module_name = "admin";
    var GetUploadify_url = "/uploads.html";
    // 插件专用旧版上传图片框
    if ('Weapp@execute' == "Article@add") {
      GetUploadify_url = "/uploads.html";
    }
    var __root_dir__ = "";
    var __lang__ = "cn";
    var __seo_pseudo__ = 3;
    var __web_xss_filter__ = 0;
    var __is_mobile__ = 0;
    var __security_ask_open__ = 0;
</script>
<link href="/public/static/admin/js/jquery-ui/jquery-ui.min.css?v=v1.6.7" rel="stylesheet" type="text/css"/>
<link href="/public/static/admin/js/perfect-scrollbar.min.css?v=v1.6.7" rel="stylesheet" type="text/css"/>
<!-- <link type="text/css" rel="stylesheet" href="/public/plugins/tags_input/css/jquery.tagsinput.css?v=v1.6.7"> -->
<style type="text/css">html, body { overflow: visible;}</style>
<link href="/public/static/admin/css/diy_style.css?v=v1.6.7" rel="stylesheet" type="text/css" />
    <link href="/public/static/admin/css/theme_style.css?v=v1.6.7_1720001269" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/public/static/common/js/jquery.min.js?t=v1.6.7"></script>
<!-- <script type="text/javascript" src="/public/plugins/tags_input/js/jquery.tagsinput.js?v=v1.6.7"></script> -->
<script type="text/javascript" src="/public/static/admin/js/jquery-ui/jquery-ui.min.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/plugins/layer-v3.1.0/layer.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.cookie.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/admin.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.validation.min.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/common.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/perfect-scrollbar.min.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.mousewheel.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/plugins/layui/layui.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/common/js/jquery.lazyload.min.js?v=v1.6.7"></script>
<script src="/public/static/admin/js/myFormValidate.js?v=v1.6.7"></script>
<script src="/public/static/admin/js/myAjax2.js?v=v1.6.7"></script>
<script src="/public/static/admin/js/global.js?v=v1.6.7"></script>

<link rel="stylesheet" href="/vendor/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="/vendor/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="/vendor/kindeditor/kindeditor-all-min.js"></script>
	<script charset="utf-8" src="/vendor/kindeditor/kindeditor-all.js"></script>
	<script charset="utf-8" src="/vendor/kindeditor/lang/zh-CN.js"></script>
	<script charset="utf-8" src="/vendor/kindeditor/plugins/code/prettify.js"></script>

<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content1"]', {
				cssPath : '/vendor/kindeditor/plugins/code/prettify.css',
				allowFileManager : true
			});
			prettyPrint();
		});
	</script>

<style>
    #edui63{
        display: none !important;
    }
</style>

<link href="css/index.css" rel="stylesheet" type="text/css" />
    <script src="js/vue.min.js"></script>
    <script src="js/vue-resource.min.js"></script>
    <script src="js/index.js"></script>


</head>

    <script type="text/javascript" src="/public/plugins/Ueditor/ueditor.config.js?t=v1.6.7"></script>
    <script type="text/javascript" src="/public/plugins/Ueditor/ueditor.all.min.js?t=v1.6.7"></script>
    <script type="text/javascript" src="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js?t=v1.6.7"></script>

<body class="bodysy-w">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div id="geduan_div" class="h10"></div>
<div id="page_div" class="page min-hg-c mb-20" style="min-width:auto;box-shadow:none;">
    <div class="fixed-bar">
        <div class="item-title">
                <a class="back_xin" href="javascript:void(0);"  onclick="window.location.href = 'https://demo.yiyocms.com/login.php?m=admin&amp;c=Archives&amp;a=index_archives&amp;typeid=9&amp;lang=cn'"  title="返回"><i class="iconfont e-fanhui"></i></a>
<!-- 返回箭头 -->
            <a class="back_sz" href="javascript:void(0);"  data-href="/login.php?m=admin&c=Article&a=help&lang=cn" onclick="openHelpframe(this, '设置与帮助', '500px', '100%', 'r');" title="设置与帮助"><i class="iconfont e-shezhi-tongyong"></i></a>
            <div class="subject">
                <h3>编辑文档</h3>
                <h5></h5>
            </div>
           
        </div>
    </div>

    <form class="form-horizontal" id="post_form" action="" method="post">
        <!-- 常规信息 -->
        <div class="ncap-form-default tab_div_1">
            <dl class="row">
                <dt class="tit">
                    <label for="title"><em>*</em>文档标题</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="title" value="" id="title" v-model="title" class="input-txt" maxlength="200" >
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    副标题：<input type="text" name="subtitle" v-model="subtitle" value="" id="subtitle" class="w200">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="title"><em>*</em>栏目分类</label>
                </dt>
                <dd class="opt">  
                    <select name="typeid" v-model="typeid" id="typeid">
                        <option value="0">请选择栏目…</option>
                        
                        <option v-for="voption in option" :value="voption.id" data-grade="0" data-current_channel="6"  style="background-color:#f5f5f5;">{{voption.typename}}</option>
                        
                        
                        <!--<option value="9" data-grade="1" data-current_channel="1" selected="true">&nbsp;&nbsp;&nbsp;&nbsp;公司荣誉</option><option value="2" data-grade="0" data-current_channel="1">新闻动态</option><option value="10" data-grade="1" data-current_channel="1">&nbsp;&nbsp;&nbsp;&nbsp;公司动态</option><option value="11" data-grade="1" data-current_channel="1">&nbsp;&nbsp;&nbsp;&nbsp;行业资讯</option><option value="12" data-grade="1" data-current_channel="1">&nbsp;&nbsp;&nbsp;&nbsp;媒体报道</option>                    -->
                        
                        
                        </select>
                    <span class="err"></span>
					<p class="notic">谨慎切换，自定义字段的内容会随着栏目切换而清空，在保存之前不受影响！</p>
                </dd>
            </dl>
                       
                       
            
            <dl class="row" style="z-index:2;">
                <dt class="tit">
                    <label>文档标签</label>
                </dt>
                <dd class="opt">          
                    <input type="text" value="" name="tags" v-model="tags" id="tags" class="input-txt" placeholder="多个标签之间以逗号隔开" autocomplete="off"  onfocus="$('#often_tags').hide();"  onpaste="this.value=this.value.replace(/[\，]/g,',')">&nbsp;
                   <img id="tag_loading" src="/public/static/common/images/loading.gif" style="display: none;" />
                    <div class="often_tags" id="often_tags" data-opt="add" style="display: none;"></div>
                    <div class="often_tags" id="often_tags_input" style="display: none;"></div>
                    <input type="hidden" id="tags_click_count">
                </dd>
            </dl>
            <dl class="row  none  ">
                
            </dl>
            <dl class="row">
                <dt class="tit">
                  <label>封面图片</label>
                </dt>
                <dd class="opt">
                    <div class="input-file-show div_litpic_local">
                        <span class="show">
                            <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="javascript:void(0);">
                                <i id="img_i" class="fa fa-picture-o" onmouseover="" onmouseout="layer.close(layer_tips);"></i>
                            </a>
                        </span>
                        <span class="type-file-box">
                            <input type="text" id="litpic_local" v-model="litpic" name="litpic_local"  class="type-file-text" autocomplete="off">
                            <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                            <input class="type-file-file" @click.prevent="GetUploadify('litpic_local')" onClick="GetUploadify(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo"
                                   title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
                    </div>
                    <input type="text" id="litpic_remote" name="litpic_remote" value="" placeholder="http://" class="input-txt" onKeyup="keyupRemote(this, 'litpic');" style="display: none;">
                    &nbsp;
                    <label><input type="checkbox" name="is_remote" id="is_remote" value="1" onClick="clickRemote(this, 'litpic');">远程图片</label>
                    <span class="err"></span>
                    <p class="notic">当没有手动上传图片时候，会自动提取正文的第一张图片作为缩略图</p>
                </dd>
            </dl>
            
    
            
            <dl>
                <dd>
                    <textarea  v-model="content" name="content1" cols="100" rows="20" style="width:700px;height:400px;visibility:hidden;">{{content}}</textarea>
                </dd>
            </dl>
            
            
            
<!-- 用户自定义扩展模板文件 -->

<!-- 用户自定义扩展模板文件，仅用于文档的新增和编辑页面 -->


<!-- 这里自定义HTML表单代码 -->

<!-- end -->
<script>
    // 获取联动地址
    function GetFieldRegionData_1670295376(t,type){
        var name = $(t).attr('data-name');
        var parent_id = parseInt($(t).val());

        if(!parent_id || 0 >= parent_id){
            if ('province' == type) {
                $('#city_'+name).hide();
                $('#area_'+name).hide();
            }else if ('city' == type){
                $('#area_'+name).hide();
            }
            return false;
        }

        var url = "/login.php?m=admin&c=Field&a=ajax_get_region_data&lang=cn";
        $.ajax({
            url: url,
            data: {parent_id:parent_id,_ajax:1},
            type:'post',
            dataType:'json',
            success:function(res){
                if (res.region_html) {
                    // 输出下一级栏目选项
                    if ('province' == type) {
                        res = '<option value="-1">请选择</option>'+ res.region_html;
                        $('#city_'+name).empty().html(res);
                        $('#city_'+name).show();
                        $('#area_'+name).hide();
                        $('#area_'+name).empty();
                    }else if ('city' == type){
                        res = '<option value="-1">请选择</option>'+ res.region_html;
                        $('#area_'+name).empty().html(res);
                        $('#area_'+name).show();
                    }
                }
            },
            error : function(e) {
                layer.closeAll();
                layer.alert(e.responseText, {icon: 5});
            }
        });
    }
</script>
                <!-- HTML文本 start -->
                                   
                     
                        
            
            
            

        </div>
        <!-- 常规信息 -->
        <!-- SEO参数 -->
        <div class="ncap-form-default tab_div_2" style="">
            <dl class="row">
                <dt class="tit">
                    <label for="seo_title">SEO标题</label>
                </dt>
                <dd class="opt">
                    <input type="text" value="" name="seo_title" v-model="seo_title" id="seo_title" class="input-txt">
					<span class="err"></span>
                    <p class="notic">一般不超过80个字符，为空时系统自动构成，可以到 <a href="/login.php?m=admin&c=Seo&a=index&inc_type=seo&lang=cn">SEO设置 - SEO基础</a> 中设置构成规则。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>SEO关键词</label>
                </dt>
                <dd class="opt">          
                    <textarea rows="5" cols="60" id="seo_keywords" v-model="seo_keywords" name="seo_keywords" style="height:20px;"></textarea>
                    <span class="err"></span>
                    <p class="notic">一般不超过100个字符，多个关键词请用英文逗号（,）隔开，建议3到5个关键词。</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>SEO描述</label>
                </dt>
                <dd class="opt">          
                    <textarea rows="5" cols="60" id="seo_description" v-model="seo_description" name="seo_description" style="height:54px;" class="keywordsTextarea" onkeyup="monitorInputStr();" onkeypress="monitorInputStr();"></textarea>
                    <span class="err"></span>
                    <p class="notic">一般不超过80个字符，不填写时系统自动提取正文的前80个字符</p>
                    <p class="notic2 none" id="beenWritten">你已输入<span id="beenWrittenStr">0</span>个字符</p>
                </dd>
            </dl>
        </div>
        <!-- SEO参数 -->
        <!-- 其他参数 -->
        <div class="ncap-form-default tab_div_3" style="">
            <dl class="row">
                <dt class="tit">
                    <label for="author">作者</label>
                </dt>
                <dd class="opt">
                    <input type="text" value="小编" name="author" v-model="author" id="author" class="input-txt">
                   
					<span class="err"></span>	
                    <p class="notic">发布时将显示默认名称（当前管理员笔名），点击设置可修改默认名称</p>
                </dd>
            </dl>
            <dl class="row dl_origin">
                <dt class="tit">
                    <label>来源</label>
                </dt>
                <dd class="opt origin-hot">
                    <input type="text" value="网络" name="origin" v-model="origin" id="origin" class="input-txt" onclick="searchOrigin(this);" autocomplete="off">
                    <div class="origin-hot-list" style="display: none;" id="search_keywords_list_origin"></div>
                    <textarea id="system_originlist_str" style="display: none;">网络</textarea>
                    
                    <span class="err"></span>
                    <p class="notic">为空时默认“网络”</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label>点击数</label>
                </dt>
                <dd class="opt">    
                    <input type="text" value="880" name="click" id="click" v-model="click" class="input-txt">
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            
            <!-- #weapp_UsersGroup_content_users_id=#--><!-- #weapp_UsersGroup_content# -->
            <dl class="row">
                <dt class="tit">
                    <label for="articleForm">发布时间</label>
                </dt>
                <dd class="opt">
                    <input type="text" class="input-txt" id="add_time" v-model="add_time" name="add_time" value="2024-07-23 13:05:22" autocomplete="off">        
                    <span class="add-on input-group-addon">
                        <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
                    </span> 
                    <span class="err"></span>
                </dd>
            </dl>
           
            
        </div>
        <!-- 其他参数 -->
        <!-- #weapp_div# -->
        <div class="ncap-form-default">
            <div class="bot2">
                <textarea name="free_content" id="free_content" style="display: none;"></textarea>
                <input type="hidden" name="gourl" value="">
                <input type="hidden" name="editor_addonFieldExt" id="editor_addonFieldExt" value="">
                <a href="JavaScript:;" @click.prevent="check_submit()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
                    <a class="ncap-btn-big ncap-btn-no" href="javascript:void(0);"  onclick="window.location.href = 'https://demo.yiyocms.com/login.php?m=admin&amp;c=Archives&amp;a=index_archives&amp;typeid=9&amp;lang=cn'"  title="返回">返回</a>
<!-- 返回按钮 -->
            </div>
        </div> 
    </form>
</div>
<script type="text/javascript">
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#add_time'
            ,type: 'datetime'
        });
    })

    $(function () {
        try {
            var web_citysite_open = 0;
            var site_province_id = 0;
            var site_city_id = 0;
            var site_area_id = 0;
            if (web_citysite_open > 0 && site_province_id > 0) {
                $('select[name=province_id]').val(site_province_id);
                set_city_list(site_city_id);
                set_area_list(site_area_id);
            }
        }catch(e){}
        
        //选项卡切换列表
        $('.tab-base').find('.tab').click(function(){
            $('.tab-base').find('.tab').each(function(){
                $(this).removeClass('current');
            });
            $(this).addClass('current');
            var tab_index = $(this).data('index');
            $(".tab_div_1, .tab_div_2, .tab_div_3").hide();          
            $(".tab_div_body").hide();
            $(".tab_div_"+tab_index).show();
            layer.closeAll();
        });

        $('input[name=is_jump]').click(function(){
            if ($(this).is(':checked')) {
                $('.dl_jump').show();
            } else {
                $('.dl_jump').hide();
            }
        });

        var dftypeid = 9;
        $('#typeid').change(function(){
            var current_channel = $(this).find('option:selected').data('current_channel');
            if (0 < $(this).val() && 1 != current_channel) {
                showErrorMsg('请选择对应模型的栏目！');
                $(this).val(dftypeid);
            } else if (1 == current_channel) {
                layer.closeAll();
            }
            GetAddonextitem(1, $(this).val(), 1, 0, true);
        });

        $(document).click(function(){
            $('#often_tags').hide();
            $('#often_tags_input').hide();
            event.stopPropagation();
        });

        $('#often_tags').click(function(){
            $('#often_tags').show();
            event.stopPropagation();
        });

        $('input[name=tags]').keyup(function(){
            var tags = $.trim($(this).val());
            $('#seo_keywords').val(tags);
        });

        $('input[name=restric_type]').click(function(){
            $('#dl_arc_level_id').hide();
            $('#dl_users_price').hide();
            $('#no_vip_pay_label').hide();
            $('#div_free_html').hide();
            var restric_type = $(this).val();
            $('#arc_level_id').find('option:eq(0)').attr('selected',true);
            if (0 < restric_type) {
                $('#div_free_html').show();
            }
            if (-1 < $.inArray(restric_type, ['1','3'])) {
                $('#dl_users_price').show();
            }
            if (-1 < $.inArray(restric_type, ['2','3'])) {
                $('#dl_arc_level_id').show();
                if (2 == restric_type) {
                    $('#no_vip_pay_label').show();
                    if ($('#no_vip_pay').is(':checked')){
                        $('#dl_users_price').show();
                    }
                }
            }
        });
    });

    // 判断输入框是否为空
    function check_submit(){
        if($.trim($('input[name=title]').val()) == ''){
            $($('.tab-base').find('.tab')[0]).trigger('click'); 
            showErrorMsg('标题不能为空！');
            $('input[name=title]').focus();
            return false;
        }
        if ($('#typeid').val() == 0) {
            $($('.tab-base').find('.tab')[0]).trigger('click'); 
            showErrorMsg('请选择栏目…！');
            $('#typeid').focus();
            return false;
        }
        var restric_type = $('input[name=restric_type]:checked').val();
        if ( restric_type == 1 ||  restric_type == 3 || (restric_type == 2 && $('#no_vip_pay').is(':checked'))){
            var users_price = $('#users_price').val();
            if (parseFloat(users_price).toString()  == "NaN") {
                users_price = 0;
            }
            if (0 == users_price || users_price == '') {
                showErrorMsg('购买价格不能为空或0');
                $('#users_price').focus();
                return false;
            } else {
                var exp = /^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
                if (!exp.test(users_price)) {
                    showErrorMsg('购买价格格式不正确！');
                    $('#users_price').focus();
                    return false;
                }
            }
        }
        
        var htmlfilename = $.trim($('input[name=htmlfilename]').val());
        if (htmlfilename != '') {
            var exp = /^\d{1,}$/;
            if (exp.test(htmlfilename)) {
                showErrorAlert('自定义文件名不能纯数字，会与文档ID冲突！');
                $('input[name=htmlfilename]').focus();
                return false;
            }
        }

        layer_loading('正在处理');
        if(!ajax_check_htmlfilename())
        {
            layer.closeAll();
            showErrorMsg('同栏目下，自定义文件名已存在！');
            $('input[name=htmlfilename]').focus();
            return false;
        }
        setTimeout(function (){
            editor_auto_210607();
            $('#post_form').submit();
        }, 1);
    }

    function img_call_back(fileurl_tmp)
    {
        $("#litpic_local").val(fileurl_tmp);
        $("#img_a").attr('href', fileurl_tmp);
        $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
        $("input[name=is_litpic]").attr('checked', true); // 自动勾选属性[图片]
    }

    function change_part_free(e) {
        if (1 == $(e).val()){
            $('#dl_size').hide();
            $('#part_free_span').show();
            open_free_content();
        }else if (2 == $(e).val()){
            $('#part_free_span').hide();
            $('#dl_size').show();
        } else{
            $('#part_free_span').hide();
            $('#dl_size').hide();
        }
    }
    function open_free_content() {
        var url = "/login.php?m=admin&c=Article&a=free_content&lang=cn";
        layer.open({
            type: 2,
            title:'请输入预览内容',
            shade: layer_shade,
            area: ['90%', '90%'], //宽高
            content: url
        });
    }
    function clickNoVipPay(obj) {
        if ($(obj).is(':checked')) {
            $('#dl_users_price').show();
        } else {
            $('#dl_users_price').hide();
        }
    }
    function set_top_author(){
        var value = $("#pen_name").val();
        top.layer.prompt({
                title:'设置作者默认名称',
                shade: layer_shade,
                btnAlign:'r',
                closeBtn: 3,
                value: value
            },
            function(val, index){
                $.ajax({
                    url: eyou_basefile + "?m=admin&c=Admin&a=ajax_setfield&_ajax=1",
                    type: 'POST',
                    dataType: 'JSON',
                    data: {field:'pen_name',value:val},
                    success: function(res){
                        if (res.code == 1) {
                            $('#pen_name').val(val);
                            top.layer.msg(res.msg, {icon: 1, time:1000});
                        } else {
                            showErrorMsg(res.msg);
                            return false;
                        }
                    },
                    error: function(e){
                        showErrorMsg(e.responseText);
                        return false;
                    }
                });
                top.layer.close(index);
            }
        );
    }
</script>
<script>
    try{
        var mt20_1649209614 = sessionStorage.getItem("mt20_1649209614");
        if (mt20_1649209614 == 1){
            $("#geduan_div").removeClass("h10");
        }else{
            $("#geduan_div").addClass("h10");
        }
    }catch(e){}
</script>
<div id="goTop">
    <a href="JavaScript:void(0);" id="btntop">
        <i class="fa fa-angle-up"></i>
    </a>
    <a href="JavaScript:void(0);" id="btnbottom">
        <i class="fa fa-angle-down"></i>
    </a>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('#think_page_trace_open').css('z-index', 99999);
    });
</script>


<script>
    var vm = new Vue({
		el: '#page_div',
		data: {
		    option:[],
			title:"",
			subtitle:"",
			typeid:0,
			tags:"",
			litpic:"",
			
			seo_title:"",
			seo_keywords:"",
			seo_description:"",
			author:"",
			origin:"",
			click:0,
			add_time:"",
			id:0,
			content:"",
			uploadsdom:""
		},
		created(){
		    let url=window.location.search;
		    let urlParams = new URLSearchParams(url);
		    this.id=urlParams.get("id");

		  //  this.searchtext=urlParams.get("searchtext");
		    

		    this.options();
		    this.inits();
		    this.timeout();
		},
		mounted(){
		    
		},
		methods: {
		    options:function(){
		        this.$http.get('api/option_cate.php').then(function(res){
                    console.log(res.body);   
                    this.option=res.body;
                },function(){
                    console.log('请求失败处理');
                });
		    },
		    inits:function(){
		        this.$http.post('api/getarchives.php',{
			        id:             this.id
			    },{emulateJSON: true}).then(function(res){
			        this.title              =res.body.title;
			        this.subtitle           =res.body.subtitle;
			        this.typeid             =res.body.typeid;
			        this.tags               =res.body.tags;
			        this.litpic             =res.body.litpic;
			        this.seo_title          =res.body.seo_title;
			        this.seo_keywords       =res.body.seo_keywords;
			        this.seo_description    =res.body.seo_description;
			        this.author             =res.body.author;
			        this.origin             =res.body.origin;
			        this.click              =res.body.click;
			        this.add_time           =res.body.add_time;
                    this.content            =res.body.content;
                    this.id                 =res.body.aid;
                    $(document.getElementsByTagName("iframe")[0].contentWindow.document.body).html(this.content);
			    },function(){
			        console.log("request fail");
			    })
		    },
		    check_submit:function(){
		        
		        this.content = $(document.getElementsByTagName("iframe")[0].contentWindow.document.body).html();
		        
		        let add_times=$("#add_time").val();
		        this.$http.post('api/archivesedit.php',{
			        title:            this.title,
			        subtitle:            this.subtitle,
			        typeid:            this.typeid,
			        tags:            this.tags,
			        litpic:            $("#litpic_local").val(),
			        seo_title:            this.seo_title,
			        seo_keywords:            this.seo_keywords,
			        seo_description:            this.seo_description,
			        author:            this.author,
			        origin:            this.origin,
			        click:            this.click,
			        add_time:            add_times ? add_times :this.add_time,
			        id:             this.id,
			        content:        this.content
			    },{emulateJSON: true}).then(function(res){
			        setTimeout(function(){
			            if(res.body.code==200){
    			            localStorage.removeItem('uploads_img_id');
    			            localStorage.removeItem('uploadsdom');
    			            window.location.href="/cate_view.html";
    			        }
			        },2000)
			        
			    },function(){
			        console.log("request fail");
			    })
		    },
		    GetUploadify:function(pic){
		        this.uploadsdom=pic;
		        localStorage.setItem('uploadsdom', this.uploadsdom);
		    },
		    timeout:function(){
		        let uploads_img_id  =localStorage.getItem('uploads_img_id');
		        if(uploads_img_id){
		            let uploadsdom      =localStorage.getItem('uploadsdom');
		            
		            this.$http.post('api/getimgurl.php',{
    			        id:            uploads_img_id
    			    },{emulateJSON: true}).then(function(res){
    			        console.log(res.body.image_url);
    			        if(res.body.image_url && uploadsdom){
    			            if($("#"+uploadsdom).val()){
    			                
    			            }else{
    			                $("#"+uploadsdom).val(res.body.image_url);
    			            }
    			            
    			        }
    			    },function(){
    			        console.log("request fail");
    			    })
		            
		            
		            
		        }
		        setTimeout(this.timeout,2000);
		        
		    }
		}
	})
</script>


</body>
</html>